<form action="" class="top30 seal3W">
    <table class="tableNew tableRaius chafeng chafengList" for="" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;">
        <tr>
            <td>抵押物查封顺序</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="抵押物查封顺序" value="<?= !empty($SealStateTable['mortgage_seal_order'])?$SealStateTable['mortgage_seal_order']:''?>" />
            </td>
        </tr>
        <tr>
            <td>是否首封</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="是否首封" value="<?= !empty($SealStateTable['is_first_seal'])?Yii::$app->params['IsFirstSeal'][$SealStateTable['is_first_seal']]['name']:''?>" />
            </td>
        </tr>
        <tr>
            <td>
                是否详勘
            </td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="是否详勘" value="<?= !empty($SealStateTable['whether_exploration'])?Yii::$app->params['WhetherExploration'][$SealStateTable['whether_exploration']]['name']:''?>" />
            </td>
        </tr>
        <tr>
            <td>查封情况描述</td>
            <td colspan="">
            	<pre><?= !empty($SealStateTable['mortgage_seal_state'])?$SealStateTable['mortgage_seal_state']:''?></pre>
           <!--     <input style="padding-left: 0; color: #333333;" type="text" readonly="readonly" name="" id="" title="查封情况描述" value="<?= !empty($SealStateTable['mortgage_seal_state'])?$SealStateTable['mortgage_seal_state']:''?>" />-->
            </td>
        </tr>
    </table>
</form>
<form action="" class="radioYn seal3Edit" style="display: none;">
    <table class="tableNew tableRaius chafeng  editTable tableEdit6 top30" for="" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;border: none;">
        <input type="text" hidden value="<?= !empty($ppseid)?$ppseid:0;?>" id="ppseid3">
        <input type="text" hidden value="<?= !empty($SealStateTable['id'])?$SealStateTable['id']:'';?>" id="mortgage_id">
        <tr>
            <td>抵押物查封顺序</td>
            <td colspan="3">
                <textarea name="" rows="" cols="" class="textarea-edit" id="mortgage_seal_order"><?= !empty($SealStateTable['mortgage_seal_order'])?$SealStateTable['mortgage_seal_order']:''?></textarea>
            </td>
        </tr>
        <tr>
            <td>是否首封</td>
            <td>

                <label for="shouFengYes">
                    <span class="<?=!empty($SealStateTable['is_first_seal'])&&$SealStateTable['is_first_seal']==1?'yesActive':'noActive'?>">是</span>
                    <input type="radio" checked="checked" class="yes" data-val="1" name = 'shouFeng' id ="shouFengYes" />
                </label>
                <label for="shouFengNo">
                    <span class="<?=!empty($SealStateTable['is_first_seal'])&&$SealStateTable['is_first_seal']==2?'yesActive':'noActive'?>">否</span>
                    <input type="radio"  class="no" name = 'shouFeng' id="shouFengNo" data-val="2"/>
                </label>

            </td>
            <td>
                是否详勘
            </td>

            <td>
                <label for="xianKanYes">
                    <span class="<?=!empty($SealStateTable['whether_exploration'])&&$SealStateTable['whether_exploration']==1?'yesActive':'noActive'?>">是</span>
                    <input type="radio" checked="checked" data-val="1" class="yes"  name = 'xianKan' id ="xianKanYes" />
                </label>
                <label for="xianKanNo">
                    <span class="<?=!empty($SealStateTable['whether_exploration'])&&$SealStateTable['whether_exploration']==2?'yesActive':'noActive'?>">否</span>
                    <input type="radio"  class="no" name = 'xianKan'  data-val="2" id="xianKanNo" />
                </label>
            </td>

        </tr>
        <tr>
            <td>查封情况描述</td>
            <td colspan="3">
                <textarea name="" rows="" class="textarea-edit" cols="" id="mortgage_seal_state"><?= !empty($SealStateTable['mortgage_seal_state'])?$SealStateTable['mortgage_seal_state']:''?></textarea>
            </td>
        </tr>
    </table>
    <div class="cancelInConfirm clearfix">
        <input id="ajaxMortgageSeal" class="cancelInConfirmActive" type="button" value="保存" />
        <input id='cancel3' type="button" value="取消" />
    </div>
</form>
<!-- textarea 高度设置对比div -->
	
<div style="max-height: 1px; overflow: hidden;">
	
	<div id="d1" style="visibility:hidden;min-height: 80px;"></div>

</div>
<script>
    $(function () {
    	
    	// textarea 高度展示问题
	    $(".textarea-edit").keyup(function(){
	           console.log(111111111);
	      var val = $(this).val();
	      $("#d1").html("<pre>" +val+" "+"</pre>");
	      var h = $("#d1").height() ;
	      $(this).height(h);
	    });
        var mortgage_id = $("#mortgage_id").val();
        $("#ajaxMortgageSeal").click(function () {
            var mortgage_seal_state = $("#mortgage_seal_state").val();
            var mortgage_seal_order = $("#mortgage_seal_order").val();
            var is_first_seal = $("#shouFengNo").prev().attr('class')=='yesActive'?2:1;
            var whether_exploration = $("#xianKanNo").prev().attr('class')=='yesActive'?2:1;
            var ppseid3 = $("#ppseid3").val();
            var url = '/project/ajax-save-mortgage-seal-table-project';
            var Pdtat = {
                'mortgage_seal_state':mortgage_seal_state,
                'mortgage_seal_order':mortgage_seal_order,
                'is_first_seal':is_first_seal,
                'whether_exploration':whether_exploration,
                'ppseid':ppseid3,
            };
            $.post(url,{data:Pdtat,mortgage_id:mortgage_id},function (res) {
                if(res){
                    layer.msg('保存成功')
                    seal2W();
                }else{
                    layer.msg('保存失败')
                }
            })
        })
        //-----------------渲染无编辑页面--------------------
        function seal2W() {
            var ppseid3 = $("#ppseid3").val();
            $.get('/project/get-mortgage-view-table',{'project_id':project_id,'postion':3,'mortgage_id':mortgage_id,"ppseid":ppseid3},function (res) {
                $(".seal3Edit").remove();
                $(".seal3W").remove();
                $("#seal3").before(res);
                $("#getSeal3").show();
            })
        }
        //-----取消保存按钮
        $("#cancel3").click(function () {
            var ppseid3 = $("#ppseid3").val();
            $.post('/project/ajax-un-lock',{'postion':111,'ppesid':ppseid3,},function (res) {
                var JSONData = JSON.parse(res)
                if (JSONData.code == 200){
                    layer.msg(JSONData.message);
                }else{
                    layer.msg(JSONData.message);
                }
            });
            $(".seal3Edit").hide();
            $(".seal3W").show();
        })
        //----是否详勘
        $("#xianKanYes").click(function () {
            $("#xianKanYes").prev().attr('class','yesActive')
            $("#xianKanNo").prev().attr('class','noActive')
        })
        $("#xianKanNo").click(function () {
            $("#xianKanYes").prev().attr('class','noActive')
            $("#xianKanNo").prev().attr('class','yesActive')
        })
        //------是否首封
        $("#shouFengYes").click(function () {
            $("#shouFengYes").prev().attr('class','yesActive')
            $("#shouFengNo").prev().attr('class','noActive')
        })
        $("#shouFengNo").click(function () {
            $("#shouFengYes").prev().attr('class','noActive')
            $("#shouFengNo").prev().attr('class','yesActive')
        })
        
    })
</script>